package com.kucowka.ws;

import javax.jws.WebMethod;
import javax.jws.WebService;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.kucowka.service.HelloWorldService;

/**
 * Implementation of <code>HelloWorldService</code>
 * 
 * @author robert
 * 
 */
@WebService(serviceName = "services")
@Service("HelloWorld")
public class HelloWorldEndpoint implements HelloWorldService {

	private static Logger logger = Logger.getLogger(HelloWorldEndpoint.class);

	/**
	 * <p>
	 * Implementation of @see com.kucowka.service.HelloWorldService#hello()
	 * </p>
	 * <p>
	 * <b>EXAMPLE METHOD</b>
	 * </p>
	 */
	@Override
	@WebMethod(operationName = "hello")
	public String hello() {
		logger.debug("hello log message");
		return "hello baby";
	}

	/**
	 * Implementation of {@link #add(int, int)}
	 */
	@Override
	@WebMethod(operationName = "add")
	public int add(int a, int b) {
		logger.debug("adding two numbers: " + a + " " + b + " with result "
				+ (a + b));
		return a + b;
	}
}
